{aide_template 'common/header'}
<link href="{$aideUrl}web/resource/css/util.min.css" rel="stylesheet">
<script type="text/javascript" src="{$aideUrl}web/resource/js/util.min.js?v=20170912"></script>
<style>
    .label-default{background-color:#d1dade;color:#5e5e5e;}
    .input-group-addon .radio-inline, .input-group-addon .checkbox-inline{padding-top:0; line-height:0.95;}
    .dropdown-menu{ min-width:145px; }
    .multi-img-details .multi-item{height:auto;}
    #member.multi-img-details .multi-item{text-align:center; max-width:100px;}
    #member.multi-img-details .multi-item img{ max-width:90px; max-height:90px;}
    #member.multi-img-details .multi-item .title{ overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
    #myTab2.nav-tabs{border-color: #1ab394;}
    #myTab2.nav-tabs>li>a{border-radius:0!important;padding: 7px 15px;}
    #myTab2.nav-tabs>li>a:hover{ color:#333}
    #myTab2.nav-tabs>li.active>a, #myTab2.nav-tabs>li.active>a:hover, #myTab2.nav-tabs>li.active>a:focus{color: #FFF;border-radius:0;background-color: #1ab394;border-color: #1ab394;}
    #options.markethide .optmarket, .markethide.market{display:none}
</style>
<link href="{$_W['siteroot']}web/resource/components/select2/select2.min.css" rel="stylesheet">
{if $op == 'display'}
<ol class="breadcrumb we7-breadcrumb" style="display:none">
    <a href="./index.php?c=site&amp;a=article&amp;"><i class="wi wi-back-circle"></i> </a>
    <li><a href="./index.php?c=site&amp;a=article&amp;">合作咨询</a></li>
</ol>
<ul class="nav nav-tabs" id="myTab">
    <li class="active"><a href="#tab_basic">咨询列表</a></li>
</ul>

<form class="form-horizontal" action="" method="post">
    <div class="panel panel-default">
        <div class="table-responsive">
            <table class="table table-hover table-bordered">
                <thead class="navbar-inner">
                <tr>
                    <th class="text-center" style="width:40px;">
                        <input type="checkbox" name="checkall" value="" id="checkall" onClick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});">
                    </th>
                    <th class="text-center" style="width:40px;">ID</th>
                    <th class="text-left">咨询人</th>
                    <th class="text-left">咨询人联系电话</th>
                    <th class="text-left">咨询人邮箱</th>
                    <th class="text-left">咨询分类</th>
                    <th class="text-left">咨询内容</th>
                    <th class="text-left">咨询时间</th>
                    <th class="text-center">操作</th>
                </tr>
                </thead>
                <tbody style="text-align: center;">
                    {loop $cooper $item}
                    <tr>
                        <td class="text-center"><input type="checkbox" name="check" value="{$item['id']}" class="items"></td>
                        <td>{$item['id']}</td>
                        <td class="text-left">{$item['name']}</td>
                        <td class="text-left">{$item['mobile']}</td>
                        <td class="text-left">{$item['email']}</td>
                        <td class="text-left">{$item['type']}</td>
                        <td class="text-left">{$item['content']}</td>
                        <td class="text-left">{$item['created_at']}</td>
                        <td class="text-center">
                            <div class="btn-group">
                                <a href="javascript:void(0);" class="js-delete btn btn-danger btn-sm" data-id="{$item['id']}">删除</a>
                            </div>
                        </td>
                    </tr>
                    {/loop}
                </tbody>
            </table>
        </div>
    </div>
    <div class="pull-right">{$pager}</div>
</form>
<script>
    //删除效果b，单条操作
    $('.js-delete').click(function(e) {
        e.stopPropagation();
        var $this = $(this);
        var cooperid = $this.data('id');
        util.nailConfirm(this, function(state) {
            if (!state) return;
            $.post("{php echo web_url('cooper/cooper/delete')}", {cooperid : cooperid}, function(data) {
                if(!data.errno){
                    $this.parents('tr').remove();
                }
                util.tips(data.message);
            }, 'json');
        }, {html:"确定删除？",placement: $this.data('placement')});
    });
</script>
{/if}
{aide_template 'common/footer'}
